package cn.com.api.mapper.base;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.*;

import cn.com.api.entity.ApiT_postage;

//DAO
public interface T_postageMapperBase {

	// 根据id查看
	@Select("SELECT * FROM t_postage  WHERE id = #{id}")
	public ApiT_postage findT_postageById(Integer id);

	// 查看数据集
	@Select("SELECT * FROM T_postage")
	public List<ApiT_postage> findT_postages();

	// 根据条件查看数据集
	public List<Map<String, Object>> findT_postagesByMap(HashMap condition);

	// 添加
	@Insert("INSERT INTO t_postage (province, city, weight_1th, price_1th, next_prince, ext_1, ext_2, ext_3, ext_4, ext_5, express_type) VALUES (#{province}, #{city}, #{weight_1th}, #{price_1th}, #{next_prince}, #{ext_1}, #{ext_2}, #{ext_3}, #{ext_4}, #{ext_5}, #{express_type})")
	@Options(useGeneratedKeys = true, keyProperty = "id")
	public int insertT_postage(ApiT_postage t_postage);

	// 修改
	@Update("UPDATE t_postage SET province = #{province}, city = #{city}, weight_1th = #{weight_1th}, price_1th = #{price_1th}, next_prince = #{next_prince}, ext_1 = #{ext_1}, ext_2 = #{ext_2}, ext_3 = #{ext_3}, ext_4 = #{ext_4}, ext_5 = #{ext_5}, express_type = #{express_type} WHERE id = #{id}")
	public int updateT_postage(ApiT_postage t_postage);

	// 删除
	@Delete("DELETE FROM t_postage  WHERE id = #{id}")
	public int deleteT_postage(Integer id);

	// Foreign keys revelant

	// region Indexs revelant

}
